home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------
- // Menus.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
- // From: Menus.pas
- //----------------------------------------------------------------------------
- #ifndef MenusHPP
- #define MenusHPP
- //----------------------------------------------------------------------------
- #include <Messages.hpp>
- #include <Classes.hpp>
- #include <SysUtils.hpp>
- #include <Windows.hpp>
- #include <System.hpp>
- #pragma warn -par
- #pragma warn -hid
- #pragma warn -inl
-
- namespace Menus
- {
- //-- type declarations -------------------------------------------------------
- class __declspec(delphiclass) EMenuError;
- class __declspec(pascalimplementation) EMenuError : public Sysutils::Exception
- {
- typedef Sysutils::Exception inherited;
-
- public:
- /* Exception.Create */ __fastcall EMenuError(const System::AnsiString Msg) : Sysutils::Exception(Msg
- ) { }
- /* Exception.CreateFmt */ __fastcall EMenuError(const System::AnsiString Msg, const System::TVarRec
- * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
- /* Exception.CreateRes */ __fastcall EMenuError(int Ident) : Sysutils::Exception(Ident) { }
- /* Exception.CreateResFmt */ __fastcall EMenuError(int Ident, const System::TVarRec * Args, const int
- Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
- /* Exception.CreateHelp */ __fastcall EMenuError(const System::AnsiString Msg, int AHelpContext) :
- Sysutils::Exception(Msg, AHelpContext) { }
- /* Exception.CreateFmtHelp */ __fastcall EMenuError(const System::AnsiString Msg, const System::TVarRec
- * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
- ) { }
- /* Exception.CreateResHelp */ __fastcall EMenuError(int Ident, int AHelpContext) : Sysutils::Exception(
- Ident, AHelpContext) { }
- /* Exception.CreateResFmtHelp */ __fastcall EMenuError(int Ident, const System::TVarRec * Args, const
- int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext) { }
-
- public:
- /* TObject.Destroy */ __fastcall virtual ~EMenuError(void) { }
-
- };
-
- enum TMenuBreak { mbNone, mbBreak, mbBarBreak };
-
- typedef Word TShortCut;
-
- typedef void __fastcall (__closure *TMenuChangeEvent)(System::TObject* Sender, bool Rebuild);
-
- class __declspec(delphiclass) TMenuItem;
- class __declspec(delphiclass) TMenu;
- enum TFindItemKind { fkCommand, fkHandle, fkShortCut };
-
- class __declspec(pascalimplementation) TMenu : public Classes::TComponent
- {
- typedef Classes::TComponent inherited;
-
- private:
- TMenuItem* FItems;
- HWND FWindowHandle;
- System::AnsiString FMenuImage;
- virtual void __fastcall MenuChanged(System::TObject* Sender, bool Rebuild);
- void __fastcall SetWindowHandle(HWND Value);
- bool __fastcall UpdateImage(void);
-
- protected:
- virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
- virtual HMENU __fastcall GetHandle(void);
- virtual void __fastcall SetChildOrder(Classes::TComponent* Child, int Order);
-
- public:
- __fastcall virtual TMenu(Classes::TComponent* AOwner);
- __fastcall virtual ~TMenu(void);
- bool __fastcall DispatchCommand(Word ACommand);
- bool __fastcall DispatchPopup(HMENU AHandle);
- TMenuItem* __fastcall FindItem(int Value, TFindItemKind Kind);
- Classes::THelpContext __fastcall GetHelpContext(Word Value, bool ByCommand);
- bool __fastcall IsShortCut(Messages::TWMKey &Message);
- __property HMENU Handle = {read=GetHandle, nodefault};
- __property HWND WindowHandle = {read=FWindowHandle, write=SetWindowHandle, nodefault};
-
- __published:
- __property TMenuItem* Items = {read=FItems, nodefault};
- };
-
- class __declspec(pascalimplementation) TMenuItem : public Classes::TComponent
- {
- typedef Classes::TComponent inherited;
-
- private:
- System::AnsiString FCaption;
- HMENU FHandle;
- bool FChecked;
- bool FEnabled;
- bool FDefault;
- bool FRadioItem;
- bool FVisible;
- Byte FGroupIndex;
- TMenuBreak FBreak;
- Word FCommand;
- Classes::THelpContext FHelpContext;
- System::AnsiString FHint;
- Classes::TList* FItems;
- TShortCut FShortCut;
- TMenuItem* FParent;
- TMenuItem* FMerged;
- TMenu* FMenu;
- TMenuChangeEvent FOnChange;
- Classes::TNotifyEvent FOnClick;
- void __fastcall AppendTo(HMENU Menu);
- void __fastcall ClearHandles(void);
- void __fastcall ReadShortCutText(Classes::TReader* Reader);
- void __fastcall MergeWith(TMenuItem* Menu);
- void __fastcall RebuildHandle(void);
- void __fastcall PopulateMenu(void);
- void __fastcall SubItemChanged(System::TObject* Sender, bool Rebuild);
- void __fastcall WriteShortCutText(Classes::TWriter* Writer);
- void __fastcall VerifyGroupIndex(int Position, Byte Value);
-
- protected:
- virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
- HMENU __fastcall GetHandle(void);
- int __fastcall GetCount(void);
- virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
- TMenuItem* __fastcall GetItem(int Index);
- int __fastcall GetMenuIndex(void);
- virtual Classes::TComponent* __fastcall GetParentComponent(void);
- virtual void __fastcall MenuChanged(bool Rebuild);
- virtual bool __fastcall HasParent(void);
- void __fastcall SetBreak(TMenuBreak Value);
- void __fastcall SetCaption(const System::AnsiString Value);
- void __fastcall SetChecked(bool Value);
- virtual void __fastcall SetChildOrder(Classes::TComponent* Child, int Order);
- void __fastcall SetDefault(bool Value);
- void __fastcall SetEnabled(bool Value);
- void __fastcall SetGroupIndex(Byte Value);
- void __fastcall SetMenuIndex(int Value);
- virtual void __fastcall SetParentComponent(Classes::TComponent* Value);
- void __fastcall SetRadioItem(bool Value);
- void __fastcall SetShortCut(TShortCut Value);
- void __fastcall SetVisible(bool Value);
-
- public:
- __fastcall virtual TMenuItem(Classes::TComponent* AOwner);
- __fastcall virtual ~TMenuItem(void);
- HIDESBASE void __fastcall Insert(int Index, TMenuItem* Item);
- void __fastcall Delete(int Index);
- virtual void __fastcall Click(void);
- int __fastcall IndexOf(TMenuItem* Item);
- void __fastcall Add(TMenuItem* Item);
- HIDESBASE void __fastcall Remove(TMenuItem* Item);
- __property Word Command = {read=FCommand, nodefault};
- __property HMENU Handle = {read=GetHandle, nodefault};
- __property int Count = {read=GetCount, nodefault};
- __property TMenuItem* Items[int Index] = {read=GetItem/*, default*/};
- __property int MenuIndex = {read=GetMenuIndex, write=SetMenuIndex, nodefault};
- __property TMenuItem* Parent = {read=FParent, nodefault};
-
- __published:
- __property TMenuBreak Break = {read=FBreak, write=SetBreak, default=0};
- __property System::AnsiString Caption = {read=FCaption, write=SetCaption, nodefault};
- __property bool Checked = {read=FChecked, write=SetChecked, default=0};
- __property bool Default = {read=FDefault, write=SetDefault, default=0};
- __property bool Enabled = {read=FEnabled, write=SetEnabled, default=1};
- __property Byte GroupIndex = {read=FGroupIndex, write=SetGroupIndex, default=0};
- __property Classes::THelpContext HelpContext = {read=FHelpContext, write=FHelpContext, default=0};
- __property System::AnsiString Hint = {read=FHint, write=FHint, nodefault};
- __property bool RadioItem = {read=FRadioItem, write=SetRadioItem, default=0};
- __property TShortCut ShortCut = {read=FShortCut, write=SetShortCut, nodefault};
- __property bool Visible = {read=FVisible, write=SetVisible, default=1};
- __property Classes::TNotifyEvent OnClick = {read=FOnClick, write=FOnClick};
- };
-
- class __declspec(delphiclass) TMainMenu;
- class __declspec(pascalimplementation) TMainMenu : public TMenu
- {
- typedef TMenu inherited;
-
- private:
- TMenuItem* MergedMenu;
- HMENU FOle2Menu;
- bool FAutoMerge;
- Byte FReserved;
- void __fastcall ItemChanged(void);
- virtual void __fastcall MenuChanged(System::TObject* Sender, bool Rebuild);
- void __fastcall SetAutoMerge(bool Value);
-
- protected:
- virtual HMENU __fastcall GetHandle(void);
-
- public:
- void __fastcall Merge(TMainMenu* Menu);
- void __fastcall Unmerge(TMainMenu* Menu);
- void __fastcall PopulateOle2Menu(HMENU SharedMenu, const int * Groups, const int Groups_Size, long
- * Widths, const int Widths_Size);
- void __fastcall GetOle2AcceleratorTable(HACCEL &AccelTable, int &AccelCount, const int * Groups, const
- int Groups_Size);
- void __fastcall SetOle2MenuHandle(HMENU Handle);
-
- __published:
- __property bool AutoMerge = {read=FAutoMerge, write=SetAutoMerge, default=0};
- public:
- /* TMenu.Create */ __fastcall virtual TMainMenu(Classes::TComponent* AOwner) : Menus::TMenu(AOwner)
- { }
- /* TMenu.Destroy */ __fastcall virtual ~TMainMenu(void) { }
-
- };
-
- enum TPopupAlignment { paLeft, paRight, paCenter };
-
- class __declspec(delphiclass) TPopupMenu;
- class __declspec(pascalimplementation) TPopupMenu : public TMenu
- {
- typedef TMenu inherited;
-
- private:
- TPopupAlignment FAlignment;
- bool FAutoPopup;
- Classes::TComponent* FPopupComponent;
- Classes::TNotifyEvent FOnPopup;
- void __fastcall DoPopup(System::TObject* Item);
- HIDESBASE Classes::THelpContext __fastcall GetHelpContext(void);
- void __fastcall SetHelpContext(Classes::THelpContext Value);
-
- public:
- __fastcall virtual TPopupMenu(Classes::TComponent* AOwner);
- __fastcall virtual ~TPopupMenu(void);
- virtual void __fastcall Popup(int X, int Y);
- __property Classes::TComponent* PopupComponent = {read=FPopupComponent, write=FPopupComponent, nodefault
- };
-
- __published:
- __property TPopupAlignment Alignment = {read=FAlignment, write=FAlignment, default=0};
- __property bool AutoPopup = {read=FAutoPopup, write=FAutoPopup, default=1};
- __property Classes::THelpContext HelpContext = {read=GetHelpContext, write=SetHelpContext, default=0
- };
- __property Classes::TNotifyEvent OnPopup = {read=FOnPopup, write=FOnPopup};
- };
-
- //-- var, const, procedure ---------------------------------------------------
- #define scShift (Word)(8192)
- #define scCtrl (Word)(16384)
- #define scAlt (int)(32768)
- #define scNone (Byte)(0)
- extern TShortCut __fastcall ShortCut(Word Key, Classes::TShiftState Shift);
- extern void __fastcall ShortCutToKey(TShortCut ShortCut, Word &Key, Classes::TShiftState &Shift);
- extern System::AnsiString __fastcall ShortCutToText(TShortCut ShortCut);
- extern TShortCut __fastcall TextToShortCut( System::AnsiString Text);
- extern TMainMenu* __fastcall NewMenu(Classes::TComponent* Owner, const System::AnsiString AName, TMenuItem*
- const * Items, const int Items_Size);
- extern TPopupMenu* __fastcall NewPopupMenu(Classes::TComponent* Owner, const System::AnsiString AName
- , TPopupAlignment Alignment, bool AutoPopup, TMenuItem* const * Items, const int Items_Size);
- extern TMenuItem* __fastcall NewSubMenu(const System::AnsiString ACaption, Word hCtx, const System::AnsiString
- AName, TMenuItem* const * Items, const int Items_Size);
- extern TMenuItem* __fastcall NewItem(const System::AnsiString ACaption, TShortCut AShortCut, bool AChecked
- , bool AEnabled, Classes::TNotifyEvent AOnClick, Word hCtx, const System::AnsiString AName);
- extern TMenuItem* __fastcall NewLine(void);
-
- } /* namespace Menus */
-
- #pragma warn .par
- #pragma warn .hid
- #pragma warn .inl
-
- #if !defined(NO_IMPLICIT_NAMESPACE_USE)
- using namespace Menus;
- #endif
- //-- end unit ----------------------------------------------------------------
- #endif // Menus
-